package com.wangjw.springbootdemo.controller;

import com.wangjw.springbootdemo.pojo.IMoocJSONResult;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by wangjw on 18/5/29.
 */
@Controller
@RequestMapping("/err")
public class ErrorController {

    @RequestMapping("/error")
    public String error() {
        int a = 1 / 0;
        return "thymeleaf/error";
    }

    @RequestMapping("/ajaxError")
    public String ajaxError() {
        return "thymeleaf/ajaxerror";
    }

    @RequestMapping("/getAjaxError")
    @ResponseBody
    public IMoocJSONResult getAjaxError() {
        int a = 1 / 0;
        return IMoocJSONResult.ok();
    }
}
